function formatProcessHistory(r) {
    for (let i = 0; i < r.length; i++) {
        r[i].key = i + 1;
        r[i].order = i + 1;
        r[i].stageCode = r[i].stage;
        r[i].stage = getStageByCode(r[i].stage);
        r[i].isAgree = r[i].isAgree === 0 ? "否" : "是";
        r[i].isDealt = r[i].endAt === null || r[i].endAt === "" ? "未处理" : "已处理";
    }
}

function getStageByCode(stage) {
    switch (stage) {
        case 0:
            return "在线提交备案信息";
        case 1:
            return "区停车办资料初核";
        case 2:
            return "区停车办现场勘察";
        case 3:
            return "区市镇级备案审核";
    }
}

export {formatProcessHistory};